package com.tedu;

public class Test001 {
    public static void main (String[] args) {
//        int a = 99999999999999;
        long a = 99999999999999L;
        int a1 = 3;
        double b = 3.14;
        float b1 = 3.14F;

        byte x = 1;
        byte y = 2;
        int z = x + y;   //byte short char运算时  会先转成int类型

        double a3 = a1 + b;
        System.out.println("a3 = " + a3); //
        System.out.println(1 - 0.9);
        //1.java 浮点数运算不精确
        //2.计算结果与较大类型一致

        System.out.println(3.14 / 0);//Infinity
        System.out.println(0 / 0.0);//NaN  not a number
        System.out.println(0.0 / 0);//NaN  not a number


    }
}
/**
 * 整数类型: byte short  int long
 * 浮点数: float double
 * 字符: char
 * 布尔类型: boolean
 * <p>
 * String  字符串
 * <p>
 * + - * / %
 * <p>
 * 变量定义三要素:
 * 1.类型 2.名字 3.值
 * <p>
 * byte a = 1;
 * byte b= 2;
 * byte c= a+b;
 */